import request from '@/config/axios'

// 特控线配置 VO
export interface ExamControlLineVO {
  id: number // 主键ID
  examId: number // 考试ID
  lineName: string // 特控线名称
  lineType: string // 线类型
  scoreLine: number // 分数线
  conversionRatio: number // 换算比例
  province: string // 对应省份
  year: number // 对应年份
  description: string // 说明
  physicsScoreLine: number // 物理类特控线
  historyScoreLine: number // 历史类特控线
  physicsProvinceControlLine: number // 物理类省控线
  historyProvinceControlLine: number // 历史类省控线
  subjectType: string // 科目类型：物理类、历史类
  provinceControlLine: number // 对应省控线
}

// 特控线配置 API
export const ExamControlLineApi = {
  // 查询特控线配置分页
  getExamControlLinePage: async (params: any) => {
    return await request.get({ url: `/system/exam-control-line/page`, params })
  },

  // 查询特控线配置详情
  getExamControlLine: async (id: number) => {
    return await request.get({ url: `/system/exam-control-line/get?id=` + id })
  },

  // 新增特控线配置
  createExamControlLine: async (data: ExamControlLineVO) => {
    return await request.post({ url: `/system/exam-control-line/create`, data })
  },

  // 修改特控线配置
  updateExamControlLine: async (data: ExamControlLineVO) => {
    return await request.put({ url: `/system/exam-control-line/update`, data })
  },

  // 删除特控线配置
  deleteExamControlLine: async (id: number) => {
    return await request.delete({ url: `/system/exam-control-line/delete?id=` + id })
  },

  // 导出特控线配置 Excel
  exportExamControlLine: async (params) => {
    return await request.download({ url: `/system/exam-control-line/export-excel`, params })
  },
}
